package com.wangnan.springbootstudy.controller;

import com.wangnan.springbootstudy.entity.Person;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@Controller
public class HelloController {

    @RequestMapping("/hello")
    public String hello(Model model){
        List<String> list = new ArrayList<>();
        list.add("book");
        list.add("film");
        list.add("study");
        model.addAttribute("msg","hello,springboot！！");
        model.addAttribute("person",new Person("wang","nan",18,list));
        model.addAttribute("person2",list);
        return "hello";
    }
    @RequestMapping("/i18n")
    public String i18n(){
        return "i18n";
    }
}
